export const replaceImgPath = (list,name) => {

	if (!isIterable(list)){
		list[name] = list[name].replace("files","file")
		return list
	}

	for (let listKey of list) {
		listKey[name] = listKey[name].replace("files","file")
	}
	console.log(list)
	return list


}
export let showtab = true
export function setshowtab(tab){
	showtab=tab;
}
export function  getshowtab(){
	return showtab;
}

const isIterable = (obj) => {
	return  obj != null && typeof obj[Symbol.iterator] === 'function';
}


export function isMobile() {
	const userAgent = navigator.userAgent || navigator.vendor || window.opera;
	// 检查是否是移动设备
	return /android|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(userAgent);
}
